import request from '@/utils/request'

/**
 * 获取员工列表
 * @param { page, pageSize, name} params
 * @returns
 */
export function getEmployeeListAPI(params) {
    return request({
        url: '/park/sys/user',
        params
    })
}


// 获取角色信息
export function getRoleListAPI() {
    return request({
        url: '/park/sys/role'
    })
}

/**
 * 添加员工
 * @returns
 */
export function createEmployeeAPI(data) {
    return request({
        url: `/park/sys/user`,
        method: 'POST',
        data
    })
}


/**
 * 删除员工
 * @returns
 */
export function delEmployeeAPI(id) {
    return request({
        url: `/park/sys/user/${id}`,
        method: 'DELETE'
    })
}

//获取员工详细
export function detailEmployeeAPI(id) {
    return request({
        url: `/park/sys/user/${id}`,
        method: 'GET'
    })
}

// 修改员工
export function editEmployeeAPI(data) {
    return request({
        url: `/park/sys/user`,
        method: 'PUT',
        data
    })
}

/**
 * 删除员工
 * @returns
 */
export function resetEmployeeAPI(id) {
    return request({
        url: `/park/sys/user/resetPwd`,
        method: 'PUT',
        data: { id }
    })
}

